Only query the absolutely necessary attributes
authorBenjamin Otte <otte@gnome.org>
Tue, 30 Jun 2009 21:45:39 +0000 (23:45 +0200)
committerBenjamin Otte <otte@gnome.org>
Thu, 15 Oct 2009 20:00:08 +0000 (22:00 +0200)
Since the time taken by g_file_enumerate_children() depends a lot on the
attributes that are queried, we query the minimum attributes that need
to be queired to display the file chooser.

In particular, the attributes for loading the icon are ignored, as icons
are loaded on demand (see previous commit).

gtk/gtkfilechooserdefault.c

index 3abb38d7906d5b85d0fc41015cd9ca99b9a43d91..c4643037b77d1bb3fcfa15ba7faddacc8242c941 100644 (file)
@@ -191,6 +191,9 @@ typedef enum {
   SHORTCUT_TYPE_RECENT
 } ShortcutType;
 
+#define MODEL_ATTRIBUTES "standard::name,standard::type,standard::display-name," \
+                         "standard::is-hidden,standard::is-backup,standard::size," \
+                         "standard::content-type,time::modified"
 enum {
   /* the first 3 must be these due to settings caching sort column */
   MODEL_COL_NAME,
@@ -6959,7 +6962,7 @@ set_list_model (GtkFileChooserDefault *impl,
 
   impl->browse_files_model = 
     _gtk_file_system_model_new (impl->current_folder,
-        "standard,time,thumbnail::*",
+        MODEL_ATTRIBUTES,
         file_system_model_set,
         impl,
         MODEL_COL_NUM_COLUMNS,